Only seven of NATO's 30 allied countries met the military spending target of 2% of GDP set by the North Atlantic Alliance in 2022.